package com.csglxt.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.csglxt.base.DaoSupportImpl;
import com.csglxt.domain.Market;
import com.csglxt.service.MarketService;

/**
 * 
 * @ClassName: MarketServiceImpl
 * @Description: 超市业务实现类
 * @author Delver_Si
 * @date 2015-5-28 下午11:49:52
 * 
 */

@Service
@Transactional
public class MarketServiceImpl extends DaoSupportImpl<Market> implements
        MarketService {
    /**
     * 根据超市名称查询超市
     */
    public Market findMarketByName(Market market) {
        return (Market) getSession()
                .createQuery("FROM Market m where m.name = ?")
                .setParameter(0, market.getName()).uniqueResult();

    }

}
